#ifndef LOG_CONSTSMALLFILE_H
#define LOG_CONSTSMALLFILE_H

#include "utility/Noncopyable.h"

#include <memory>
#include <string>

class ConstSmallFileProxy;

class ConstSmallFile final {
public:
    explicit ConstSmallFile(const char *filename);
    ~ConstSmallFile();

    std::uintmax_t file_size() const;
    ssize_t read();
    std::string read_no_more_than(std::size_t maxSize);

private:
    NONCOPYABLE(ConstSmallFile);

    std::unique_ptr<ConstSmallFileProxy> _proxy;
    const int _fd;
};

#endif